package org.devocean.groupbuying.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@SuppressWarnings("serial")
@Entity
public class Box implements Serializable {

	@Id
	@GeneratedValue
	private Integer boxID;

	private String title;

	private Integer fgKey;

	private String pageType;

	private String clauseJoins;

	private String clauseSelect;

	private String contain;

	private String clauseFrom;

	@Column(name = "clauseWhere", columnDefinition = "TEXT")
	private String clauseWhere;

	private String clauseOrderBy;

	private Integer clauseLimit;

	private String label;

	private String link;

	private Integer auto;

	private Integer isHtml;

	private String html;

	private String partialName;

	private Integer disabled;

	@Column(name = "OPTIONS", columnDefinition = "TEXT")
	private String options;

	private String cacheKey;

	private Integer cacheTime;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parentD", referencedColumnName = "boxID", nullable = true)
	private Box box;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "box")
	private Set<Box> boxes = new HashSet<Box>();

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userID", referencedColumnName = "userID", nullable = true)
	private User owner;

	public Integer getBoxID() {
		return boxID;
	}

	public void setBoxID(Integer boxID) {
		this.boxID = boxID;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getFgKey() {
		return fgKey;
	}

	public void setFgKey(Integer fgKey) {
		this.fgKey = fgKey;
	}

	public String getPageType() {
		return pageType;
	}

	public void setPageType(String pageType) {
		this.pageType = pageType;
	}

	public String getClauseJoins() {
		return clauseJoins;
	}

	public void setClauseJoins(String clauseJoins) {
		this.clauseJoins = clauseJoins;
	}

	public String getClauseSelect() {
		return clauseSelect;
	}

	public void setClauseSelect(String clauseSelect) {
		this.clauseSelect = clauseSelect;
	}

	public String getContain() {
		return contain;
	}

	public void setContain(String contain) {
		this.contain = contain;
	}

	public String getClauseFrom() {
		return clauseFrom;
	}

	public void setClauseFrom(String clauseFrom) {
		this.clauseFrom = clauseFrom;
	}

	public String getClauseWhere() {
		return clauseWhere;
	}

	public void setClauseWhere(String clauseWhere) {
		this.clauseWhere = clauseWhere;
	}

	public String getClauseOrderBy() {
		return clauseOrderBy;
	}

	public void setClauseOrderBy(String clauseOrderBy) {
		this.clauseOrderBy = clauseOrderBy;
	}

	public Integer getClauseLimit() {
		return clauseLimit;
	}

	public void setClauseLimit(Integer clauseLimit) {
		this.clauseLimit = clauseLimit;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public Integer getAuto() {
		return auto;
	}

	public void setAuto(Integer auto) {
		this.auto = auto;
	}

	public Integer getIsHtml() {
		return isHtml;
	}

	public void setIsHtml(Integer isHtml) {
		this.isHtml = isHtml;
	}

	public String getHtml() {
		return html;
	}

	public void setHtml(String html) {
		this.html = html;
	}

	public String getPartialName() {
		return partialName;
	}

	public void setPartialName(String partialName) {
		this.partialName = partialName;
	}

	public Integer getDisabled() {
		return disabled;
	}

	public void setDisabled(Integer disabled) {
		this.disabled = disabled;
	}

	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
	}

	public String getCacheKey() {
		return cacheKey;
	}

	public void setCacheKey(String cacheKey) {
		this.cacheKey = cacheKey;
	}

	public Integer getCacheTime() {
		return cacheTime;
	}

	public void setCacheTime(Integer cacheTime) {
		this.cacheTime = cacheTime;
	}

	public Box getBox() {
		return box;
	}

	public void setBox(Box box) {
		this.box = box;
	}

	public Set<Box> getBoxes() {
		return boxes;
	}

	public void setBoxes(Set<Box> boxes) {
		this.boxes = boxes;
	}

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

}
